using System.Data;

namespace MVP.DataAccess
{
    public class DatabaseGateway
    {
        public DataTable QueryForDataTable(string expression)
        {
            using (IDatabaseConnection connection = new DatabaseConnection())
            {
                DataTable table = new DataTable();

                using (IDataReader reader = connection.CreateCommandFor(expression).ExecuteReader())
                {
                    table.Load(reader);
                }

                return table;
            }
        }
    }
}